<template>
	<view>
		<view class="rows p-left24 p-right24">
			<view class="bgwhite bor_radius_20  m-top20 p-top30 p-bot40">
				<view class="color_34 size30 bold p-bot20 p-left20">我的课程</view>
				<view class="row m-top10">
					<view @click="toUrls('/orderPage/coursePay/myCourse',true)" class="w-20 d-flex f-column a-center ">
						<image class="orderIcon" :src="staticUrl+'/images/jh_up/icon-myLesson.png'" mode="aspectFit"></image>
						<text class="m-top20">我的课程</text>
					</view>
					<view @click="toUrls('/orderPage/coursePay/myCourseList?type=2&status=1',true)" class="w-20 d-flex f-column a-center ">
						<image class="orderIcon" :src="staticUrl+'/images/jh_up/icon-studying.png'" mode="aspectFit"></image>
						<text class="m-top20">学习中</text>
					</view>
					<view @click="toUrls('/orderPage/coursePay/myCourseList?type=2&status=2',true)" class="w-20 d-flex f-column a-center ">
						<image class="orderIcon" :src="staticUrl+'/images/jh_up/icon-dateOut.png'" mode="aspectFit"></image>
						<text class="m-top20">已过期</text>
					</view>
				</view>
			</view>
		</view>
		
		<showModel @cancelFunc='showModal = false' goHome='0' v-if='showModal' type='2'></showModel>
	</view>
</template>

<script>
	export default {
		name:"userCurr",
		data() {
			return {
				staticUrl:this.staticUrl,
				showModal:false,
			};
		},
		
		methods:{
			toUrls(url, flag) { // flag:是否判断vid
		
			let that = this;
				var vid = uni.getStorageSync('vid');
				if (flag && (!vid || vid == 0)) {
					that.showModal = true;
					return
				}else{
					uni.navigateTo({
						url:url
					})
				}
				
				
			},
		}
	}
</script>

<style lang="scss" scoped>
	.orderIcon {
		width: 50rpx;
		height: 50rpx;
		margin: 0 auto;
		text-align: center;
		position: relative;
		
	}
</style>